Skip to content

fix: correct derived-field names, verify --db signature checks, and extender warnings - #600

Merged
dmealing merged 9 commits into
mainfrom
fm/mo-rc19-review-followups
Nov 18, 2026
Merged

dmealing merged 9 commits into
mainfrom
fm/mo-rc19-review-followups

Conversation

@dmealing

@dmealing dmealing commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • Names generators (Java, Kotlin, Python): <Entity>Names no longer emits a column constant for a derived (origin.*) field of an entity read from its table, matching the TypeScript and C# generators. Projections and write-through entities keep their derived-field entries, since those fields are columns of their view. Java and Kotlin also stop re-declaring inherited derived fields on abstract-base fragments where needed.
  • meta verify --db (TypeScript, migrate-ts): the origin.function signature check now follows Postgres call rules. An integer argument is accepted for bigint, numeric, real and double precision parameters, any* polymorphic parameters match any type, and a variadic function's trailing parameter count and type are not checked (its required fixed parameters still are). Genuine mismatches still fail, and the limits text printed with findings is updated.
  • Widened-extender warning (TypeScript and C# loaders): the warning now fires whenever an extender's base differs from the pre-rc.21 derivation, not only for a TPH base read through a subtype column. It names both entities and the identity.primary { extends: ... } that restores the old base. The branch also adds a Java OMDB round-trip test for the @stringValueMap enum codec.
Validation

Risk Assessment

✅ Low: The four low-severity fixes (L3 to L5, L8) are implemented in the paths the intent names. I found no new defect in the fix-round code. The only edit this pass was a stale diagnostic string.

Testing

Three scenarios were driven live against the real product: the TS meta verify widened-extender warning (positive and negative cases), meta verify --db on a disposable Postgres 16 for origin.function matching (widening, polymorphic and variadic accepted, genuine mismatch still reported), and the Python metaobjects gen names generator for derived fields (fixed tree omits the constant; base tree reproduces the bug). All three passed. Two intent items were not driven live: the Java names generator (L3) and the Java EnumCodec test (L8). The L8 change is test-only, and the Java lanes were not built here. The baseline affected run covered the change at the target commit. Overall: go, with those two untested.

  • Live validation: ✅ go - 4 of 6 scenarios driven live against the product
Scenario Result Live Evidence
L5 positive: real meta verify on a disposable non-TPH projection extender whose base changed (InvoiceRow over CustomerBase, own field extends Invoice.ref) prints the widened-extender warning naming… ✅ pass live l5-verify-positive.log; l5-meta.model.json; bun server/typescript/packages/cli/bin/meta.ts verify in a scratch project
L5 negative: an extender whose own field already names the super's base (base unchanged) produces no widened-extender warning ✅ pass live l5-verify-negative.log
L4: meta verify --db on a disposable Postgres 16 accepts Postgres-valid calls (integer arg for bigint param, polymorphic anyelement, VARIADIC trailing) and still reports a genuine declared-type mism… ✅ pass live l4-verify-db-run.log; l4-meta.probe.json; disposable postgres:16 container on tmpfs with functions verify_fn.f_widen(bigint), f_poly(anyelement), v_join(text, VARIADIC integer[]), f_mis(bigint), stopp…
L3 Python: metaobjects gen names generator for a table-backed entity with a derived field no longer emits a column constant for it, while the projection keeps its own column ✅ pass live l3-py/account_names.fixed.py, l3-py/account_view_names.fixed.py, l3-py/account_names.base.py (base commit reproduces ACCOUNT_IS_HIGH_COLUMN = "is_high"), l3-py/meta.account.json
L3 Java: the SpringNamesGenerator omits the column constant for a derived field of a table-read entity, matching the TypeScript and C# behavior ⏸️ untested no Not driven live within this turn's budget. The Java reactor needs a Maven build with Testcontainers, and only the Python live scenario was driven. The fix mirrors the Python one. The in-repo SpringNam…
L8: the Java OMDB @stringValueMap EnumCodec has round-trip test coverage (JdbcCodecRoundTripTest) ⏸️ untested no The L8 change is test-only (a new test plus a fixture), so it has no product behavior to drive live. Running it needs the Java omdb module build and a Postgres via Testcontainers, which was not run in…
Evidence: L5 positive: meta verify emits the widened-extender warning for a non-TPH extender whose base changed
meta: meta verify — running --codegen --templates (default). Explicit subverbs: --templates (prompt drift), --db/--dialect d1 (schema drift), --codegen (drift of everything `generators` declares, documentation included), --deps (dependency drift), --replay/--replay-snapshot (the committed migration chain replays from empty).
meta: meta verify — codegen gate skipped: no metaobjects.config.ts found, so there is no generated output to diff against
meta: warning: object.projection InvoiceRow: its base entity is now Customer, where before it was Invoice (rc.21: an extender with no identity of its own keeps its super's identity anchor), so its view is lowered differently and the next meta migrate replaces it. To keep the old base, declare identity.primary { extends: Invoice.<identity> }.
meta: meta verify — no template.* nodes found; the template gate had nothing to check.
meta: meta verify — not run: schema (--db <url>), codegen (--codegen), deps (--deps), replay (--replay) — a bare 'meta verify' runs the codegen and template gates (plus the requirement ledger); name each gate to run it
verify[6]{gate,ran,ok}:
  templates,true,true
  schema,false,true
  codegen,false,true
  deps,false,true
  requirements,true,true
  replay,false,true
exitCode: 0
summary: "2 gate(s) ran, all clean"
help[1]: no drift and nothing advisory to answer — nothing to do
antiPatterns:
  status: ran
  total: 0
  rows: []
requirements:
  status: ran
  total: 0
  rows: []
overlays:
  status: ran
  total: 0
  rows: []
names:
  status: ran
  total: 0
  rows: []
deprecations:
  status: ran
  total: 0
  rows: []
fields:
  status: ran
  total: 0
  rows: []
notRepresented[2]: "per-gate drift detail for every gate but schema (which template variable drifted, which generated file differs, which migration failed to replay) — printed as text on stderr; this payload carries each gate's pass/fail verdict, and the schema gate's differences in schemaDrift",the loader's own warnings and the agent-context/manifest advisories — printed as text on stderr
Evidence: L5 input model (positive case)
{ "metadata.root": { "package": "acme", "children": [
  { "object.entity": { "name": "Customer", "children": [
    { "source.rdb": { "@table": "customers" } }, { "field.long": { "name": "id" } },
    { "identity.primary": { "name": "primary", "@fields": "id" } } ] } },
  { "object.entity": { "name": "Invoice", "children": [
    { "source.rdb": { "@table": "invoices" } }, { "field.long": { "name": "id" } }, { "field.string": { "name": "ref" } },
    { "identity.primary": { "name": "primary", "@fields": "id" } } ] } },
  { "object.projection": { "name": "CustomerBase", "abstract": true, "children": [
    { "field.long": { "name": "customerId", "extends": "Customer.id" } },
    { "identity.primary": { "name": "id", "extends": "Customer.primary" } } ] } },
  { "object.projection": { "name": "InvoiceRow", "extends": "CustomerBase", "children": [
    { "source.rdb": { "@kind": "view", "@view": "v_invoice_rows" } },
    { "field.string": { "name": "ref", "extends": "Invoice.ref" } } ] } }
] } }
Evidence: L5 negative: no warning when the extender's own field names the super's base
meta: meta verify — running --codegen --templates (default). Explicit subverbs: --templates (prompt drift), --db/--dialect d1 (schema drift), --codegen (drift of everything `generators` declares, documentation included), --deps (dependency drift), --replay/--replay-snapshot (the committed migration chain replays from empty).
meta: meta verify — codegen gate skipped: no metaobjects.config.ts found, so there is no generated output to diff against
meta: meta verify — no template.* nodes found; the template gate had nothing to check.
meta: meta verify — not run: schema (--db <url>), codegen (--codegen), deps (--deps), replay (--replay) — a bare 'meta verify' runs the codegen and template gates (plus the requirement ledger); name each gate to run it
verify[6]{gate,ran,ok}:
  templates,true,true
  schema,false,true
  codegen,false,true
  deps,false,true
  requirements,true,true
  replay,false,true
exitCode: 0
summary: "2 gate(s) ran, all clean"
help[1]: no drift and nothing advisory to answer — nothing to do
antiPatterns:
  status: ran
  total: 0
  rows: []
requirements:
  status: ran
  total: 0
  rows: []
overlays:
  status: ran
  total: 0
  rows: []
names:
  status: ran
  total: 0
  rows: []
deprecations:
  status: ran
  total: 0
  rows: []
fields:
  status: ran
  total: 0
  rows: []
notRepresented[2]: "per-gate drift detail for every gate but schema (which template variable drifted, which generated file differs, which migration failed to replay) — printed as text on stderr; this payload carries each gate's pass/fail verdict, and the schema gate's differences in schemaDrift",the loader's own warnings and the agent-context/manifest advisories — printed as text on stderr
Evidence: L4: meta verify --db against disposable Postgres 16 reports only the genuine origin.function mismatch
meta: Postgres drift compared against a scratch (shadow) database.
meta: verify: origin.function signatures are compared by plain type name, allowing Postgres's implicit numeric widening (integer to bigint to numeric, and each onto real or double precision) and treating polymorphic (any*) parameters as wildcards: a json, array, enum or user-defined kind is not type-checked (only the arity is), a variadic function's trailing parameter count and type are not checked (its required fixed arity is), and a domain is compared by its own name, not its base type.
meta: meta verify — schema drift vs postgres://postgres:***@127.0.0.1:35266/postgres (2 change(s)):
meta:   + table meters
meta:   + view v_probe (declared by the metadata, not in the database)
meta:   origin.function verify_fn.f_mis on Probe.mismatch: declared (string) → decimal, which needs verify_fn.f_mis(text | character varying | character) → numeric; the database has verify_fn.f_mis(bigint) → numeric.
meta: meta verify — not run: templates (--templates), codegen (--codegen), deps (--deps), replay (--replay)
verify[6]{gate,ran,ok}:
  templates,false,true
  schema,true,false
  codegen,false,true
  deps,false,true
  requirements,true,true
  replay,false,true
exitCode: 1
summary: 1 of 2 gate(s) failed (schema)
help[1]: "the schema gate's differences are in schemaDrift — changes[] (metadata vs database, one row per change) and findings[] (migration ledger and committed snapshot)"
antiPatterns:
  status: ran
  total: 0
  rows: []
requirements:
  status: ran
  total: 0
  rows: []
overlays:
  status: ran
  total: 0
  rows: []
names:
  status: ran
  total: 0
  rows: []
deprecations:
  status: ran
  total: 0
  rows: []
fields:
  status: ran
  total: 0
  rows: []
schemaDrift:
  changes[2]{kind,object,detail}:
    create-table,table,meters
    create-view,view,"v_probe (declared by the metadata, not in the database)"
  findings[1]: "origin.function verify_fn.f_mis on Probe.mismatch: declared (string) → decimal, which needs verify_fn.f_mis(text | character varying | character) → numeric; the database has verify_fn.f_mis(bigint) → numeric."
notRepresented[2]: "per-gate drift detail for every gate but schema (which template variable drifted, which generated file differs, which migration failed to replay) — printed as text on stderr; this payload carries each gate's pass/fail verdict, and the schema gate's differences in schemaDrift",the loader's own warnings and the agent-context/manifest advisories — printed as text on stderr
Evidence: L4 input model (probe functions: widen, poly, variadic, mismatch)
{ "metadata.root": { "package": "acme", "children": [
  { "object.entity": { "name": "Meter", "children": [
    { "source.rdb": { "@table": "meters" } },
    { "field.long": { "name": "id" } },
    { "field.string": { "name": "label" } },
    { "field.int": { "name": "amount" } },
    { "identity.primary": { "name": "id", "@fields": "id" } } ] } },
  { "object.projection": { "name": "Probe", "children": [
    { "source.rdb": { "@kind": "view", "@table": "v_probe" } },
    { "field.long": { "name": "id", "extends": "Meter.id" } },
    { "field.decimal": { "name": "widen", "children": [ { "origin.function": { "@function": "f_widen", "@schema": "verify_fn", "@args": ["amount"], "@params": ["int"], "@returns": "decimal" } } ] } },
    { "field.decimal": { "name": "poly", "children": [ { "origin.function": { "@function": "f_poly", "@schema": "verify_fn", "@args": ["label"], "@params": ["string"], "@returns": "decimal" } } ] } },
    { "field.decimal": { "name": "variadic", "children": [ { "origin.function": { "@function": "v_join", "@schema": "verify_fn", "@args": ["label"], "@params": ["string"], "@returns": "decimal" } } ] } },
    { "field.decimal": { "name": "mismatch", "children": [ { "origin.function": { "@function": "f_mis", "@schema": "verify_fn", "@args": ["label"], "@params": ["string"], "@returns": "decimal" } } ] } },
    { "identity.primary": { "name": "id", "extends": "Meter.id" } } ] } }
] } }
Evidence: L3 Python: account_names.py from the base commit still emits IS_HIGH_COLUMN (pre-fix)
# @generated by metaobjects — DO NOT EDIT.
# Source metadata: Account (acme::Account)
# Extend in your own module (e.g. Account_extra.py) — nothing imports it for you.
"""GENERATED — per-object physical database names for Account (#248)."""

from __future__ import annotations

from typing import Final

ACCOUNT_TYPE: Final[str] = "object"
ACCOUNT_SUB_TYPE: Final[str] = "entity"
ACCOUNT_NAME: Final[str] = "Account"

ACCOUNT_SOURCE_PRIMARY_TYPE: Final[str] = "source"
ACCOUNT_SOURCE_PRIMARY_SUB_TYPE: Final[str] = "rdb"
ACCOUNT_SOURCE_PRIMARY_KIND: Final[str] = "table"
ACCOUNT_SOURCE_PRIMARY_TABLE: Final[str] = "accounts"

ACCOUNT_ID_FIELD: Final[str] = "id"
ACCOUNT_ID_COLUMN: Final[str] = "id"
ACCOUNT_IS_HIGH_FIELD: Final[str] = "isHigh"
ACCOUNT_IS_HIGH_COLUMN: Final[str] = "is_high"
ACCOUNT_SCORE_FIELD: Final[str] = "score"
ACCOUNT_SCORE_COLUMN: Final[str] = "score"

ACCOUNT_IDENTITY_ID_TYPE: Final[str] = "identity"
ACCOUNT_IDENTITY_ID_SUB_TYPE: Final[str] = "primary"
ACCOUNT_IDENTITY_ID_NAME: Final[str] = "id"

ACCOUNT_COLUMNS_BY_FIELD: Final[dict[str, str]] = {
    "id": ACCOUNT_ID_COLUMN,
    "isHigh": ACCOUNT_IS_HIGH_COLUMN,
    "score": ACCOUNT_SCORE_COLUMN,
}
Evidence: L3 Python: account_names.py from the fixed tree omits the derived-field constant
# @generated by metaobjects — DO NOT EDIT.
# Source metadata: Account (acme::Account)
# Extend in your own module (e.g. Account_extra.py) — nothing imports it for you.
"""GENERATED — per-object physical database names for Account (#248)."""

from __future__ import annotations

from typing import Final

ACCOUNT_TYPE: Final[str] = "object"
ACCOUNT_SUB_TYPE: Final[str] = "entity"
ACCOUNT_NAME: Final[str] = "Account"

ACCOUNT_SOURCE_PRIMARY_TYPE: Final[str] = "source"
ACCOUNT_SOURCE_PRIMARY_SUB_TYPE: Final[str] = "rdb"
ACCOUNT_SOURCE_PRIMARY_KIND: Final[str] = "table"
ACCOUNT_SOURCE_PRIMARY_TABLE: Final[str] = "accounts"

ACCOUNT_ID_FIELD: Final[str] = "id"
ACCOUNT_ID_COLUMN: Final[str] = "id"
ACCOUNT_SCORE_FIELD: Final[str] = "score"
ACCOUNT_SCORE_COLUMN: Final[str] = "score"

ACCOUNT_IDENTITY_ID_TYPE: Final[str] = "identity"
ACCOUNT_IDENTITY_ID_SUB_TYPE: Final[str] = "primary"
ACCOUNT_IDENTITY_ID_NAME: Final[str] = "id"

ACCOUNT_COLUMNS_BY_FIELD: Final[dict[str, str]] = {
    "id": ACCOUNT_ID_COLUMN,
    "score": ACCOUNT_SCORE_COLUMN,
}
Evidence: L3 Python: account_view_names.py from the fixed tree keeps the projection's doubled column
# @generated by metaobjects — DO NOT EDIT.
# Source metadata: AccountView (acme::AccountView)
# Extend in your own module (e.g. AccountView_extra.py) — nothing imports it for you.
"""GENERATED — per-object physical database names for AccountView (#248)."""

from __future__ import annotations

from typing import Final

ACCOUNTVIEW_TYPE: Final[str] = "object"
ACCOUNTVIEW_SUB_TYPE: Final[str] = "projection"
ACCOUNTVIEW_NAME: Final[str] = "AccountView"

ACCOUNTVIEW_SOURCE_PRIMARY_TYPE: Final[str] = "source"
ACCOUNTVIEW_SOURCE_PRIMARY_SUB_TYPE: Final[str] = "rdb"
ACCOUNTVIEW_SOURCE_PRIMARY_KIND: Final[str] = "view"
ACCOUNTVIEW_SOURCE_PRIMARY_VIEW: Final[str] = "v_accounts"

ACCOUNTVIEW_DOUBLED_FIELD: Final[str] = "doubled"
ACCOUNTVIEW_DOUBLED_COLUMN: Final[str] = "doubled"
ACCOUNTVIEW_ID_FIELD: Final[str] = "id"
ACCOUNTVIEW_ID_COLUMN: Final[str] = "id"

ACCOUNTVIEW_IDENTITY_ID_TYPE: Final[str] = "identity"
ACCOUNTVIEW_IDENTITY_ID_SUB_TYPE: Final[str] = "primary"
ACCOUNTVIEW_IDENTITY_ID_NAME: Final[str] = "id"

ACCOUNTVIEW_COLUMNS_BY_FIELD: Final[dict[str, str]] = {
    "doubled": ACCOUNTVIEW_DOUBLED_COLUMN,
    "id": ACCOUNTVIEW_ID_COLUMN,
}

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 5 issues (1 warning, 4 infos)
  • ⚠️ server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringNamesGenerator.java:254 - The derived-field skip is ported without the M8 compensation both reference implementations pair it with (TS codegen-ts/src/names.ts:386-394, C# CSharpNaming.cs:626-631): when the names super fragment is an abstract ENTITY (whose derived fields the fragment now drops), an object whose derived fields ARE columns must re-declare the inherited derived fields as its own. Concrete sequence: an abstract object.entity declares a derived (origin.*) field; a write-through entity (or a projection) extends it. Java: the fragment drops the constant (SpringNamesGenerator.java:464), the child keeps the field in its full fields map (columnless=false at :254) but declares only ownFields when it has a base (:586), so COLUMNS_BY_FIELD (:630) references a <FIELD>_COLUMN no emitted class declares — the generated .java does not compile. Python: the child marks the field carried_by_super (names_generator.py:485) and re-exports it from the super module that no longer defines it — ImportError at import. Both are regressions vs the base commit (the fragment previously carried the constant) and break the change's own parity claim (CHANGELOG.md 'They now match'). Sibling sites of the same invariant: SpringNamesGenerator.java:464-468 (fragment skip) and names_generator.py:473-480 (both paths).
  • ⚠️ server/typescript/packages/migrate-ts/src/introspect/declared-functions.ts:169 - The new variadic branch of signatureMatches checks only the leading fixed parameters' types and drops the required-arity check entirely, so it reports a match for a call Postgres rejects: a declared origin.function with no @params (params: [], reachable per declaredFunctions at declared-functions.ts:122-131) against pg_proc f(text, VARIADIC integer[]) with pronargdefaults=0 returns true, because fixed = min(1, 0) = 0 and the empty slice trivially matches — the drift verify --db exists to catch goes unreported. Postgres requires every non-defaulted fixed parameter and a VARIADIC parameter cannot itself carry a default, so the branch needs declared.params.length &gt;= fn.args.length - 1 - fn.defaults before the type check. The DECLARED_FUNCTION_CHECK_LIMITS text (:186-190) also says only 'arity is not checked' while trailing parameter types are unchecked too; update it with the fix.

🔧 Fix applied.
4 issues (2 warnings, 2 infos) still open:

  • ⚠️ server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringNamesGenerator.java:254 - The derived-field skip is ported without the M8 compensation both reference implementations pair it with (TS codegen-ts/src/names.ts:386-394, C# CSharpNaming.cs:626-631): when the names super fragment is an abstract ENTITY (whose derived fields the fragment now drops), an object whose derived fields ARE columns must re-declare the inherited derived fields as its own. Concrete sequence: an abstract object.entity declares a derived (origin.*) field; a write-through entity (or a projection) extends it. Java: the fragment drops the constant (SpringNamesGenerator.java:464), the child keeps the field in its full fields map (columnless=false at :254) but declares only ownFields when it has a base (:586), so COLUMNS_BY_FIELD (:630) references a <FIELD>_COLUMN no emitted class declares — the generated .java does not compile. Python: the child marks the field carried_by_super (names_generator.py:485) and re-exports it from the super module that no longer defines it — ImportError at import. Both are regressions vs the base commit (the fragment previously carried the constant) and break the change's own parity claim (CHANGELOG.md 'They now match'). Sibling sites of the same invariant: SpringNamesGenerator.java:464-468 (fragment skip) and names_generator.py:473-480 (both paths).
  • ⚠️ server/typescript/packages/migrate-ts/src/introspect/declared-functions.ts:169 - The new variadic branch of signatureMatches checks only the leading fixed parameters' types and drops the required-arity check entirely, so it reports a match for a call Postgres rejects: a declared origin.function with no @params (params: [], reachable per declaredFunctions at declared-functions.ts:122-131) against pg_proc f(text, VARIADIC integer[]) with pronargdefaults=0 returns true, because fixed = min(1, 0) = 0 and the empty slice trivially matches — the drift verify --db exists to catch goes unreported. Postgres requires every non-defaulted fixed parameter and a VARIADIC parameter cannot itself carry a default, so the branch needs declared.params.length &gt;= fn.args.length - 1 - fn.defaults before the type check. The DECLARED_FUNCTION_CHECK_LIMITS text (:186-190) also says only 'arity is not checked' while trailing parameter types are unchecked too; update it with the fix.
  • ℹ️ server/typescript/packages/migrate-ts/src/introspect/declared-functions.ts:63 - Fix-round code (L4): isPolymorphic classifies any format_type output whose bare name starts with "any" as a polymorphic pseudo-type, so a user-defined Postgres type literally named e.g. anyflags would be treated as a wildcard parameter and a genuine type mismatch on it would go unreported (silent false negative in the drift gate). Postgres has a closed set of polymorphic pseudo-types (any, anyarray, anyelement, anyenum, anynonarray, anycompatible, anycompatiblearray, anycompatiblenonarray, anycompatible range types, anyrange, anymultirange); the module already states closed sets as constants (TEXT_TYPES at :46). Reachability is very low (requires a user type whose bare lower-case name begins with "any"), hence info. The variadic branch's trailing-type skip (:171-175) is unaffected.
  • ℹ️ server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringNamesGenerator.java:266 - Fix-round note (no action demanded): the M8 compensation fires only when the names super is an ABSTRACT entity. A write-through extender whose names super is a CONCRETE plain entity declaring a derived field would still reference a &lt;FIELD&gt;_COLUMN no emitted class declares — the same class of defect — because the concrete super's own module drops the constant (plain-entity columnless) and the child does not re-declare it. This scoping is byte-for-byte the TS (names.ts:390) and C# (CSharpNaming.cs:629) reference behavior, so it is a deliberate reference tradeoff this port correctly mirrors, not a porting defect; Java/Python pre-change emitted a constant naming a nonexistent column there instead. Recording it so the abstract-only scope is a known, symmetric boundary rather than an oversight. Sibling sites, all matching the reference: SpringNamesGenerator.java:266-272, names_generator.py:478-486.

🔧 Fix applied.
4 issues (2 warnings, 2 infos) still open:

  • ℹ️ server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringNamesGenerator.java:266 - Fix-round note (no action demanded): the M8 compensation fires only when the names super is an ABSTRACT entity. A write-through extender whose names super is a CONCRETE plain entity declaring a derived field would still reference a &lt;FIELD&gt;_COLUMN no emitted class declares — the same class of defect — because the concrete super's own module drops the constant (plain-entity columnless) and the child does not re-declare it. This scoping is byte-for-byte the TS (names.ts:390) and C# (CSharpNaming.cs:629) reference behavior, so it is a deliberate reference tradeoff this port correctly mirrors, not a porting defect; Java/Python pre-change emitted a constant naming a nonexistent column there instead. Recording it so the abstract-only scope is a known, symmetric boundary rather than an oversight. Sibling sites, all matching the reference: SpringNamesGenerator.java:266-272, names_generator.py:478-486.
  • ⚠️ server/csharp/MetaObjects/Loader/ValidationPasses.cs:1435 - Sibling site the L5 fix left behind. The change widened validateExtenderSubtypeScope (validation-passes.ts:1082) so the warning fires whenever the extender's base differs from the pre-rc.21 derivation, and added the preRc21 re-derivation to _deriveBaseEntity — but only in TypeScript. The C# copy, whose doc comment claims "TS validateExtenderSubtypeScope, message for message" (ValidationPasses.cs:1420), still bails at if (discriminator is null) continue; (:1435) and still requires a subtype-bound own field before warning. Concrete sequence: the exact model of the new TS test (InvoiceRow extends an abstract projection anchored on Customer, own field ref extends Invoice.ref) loads through the C# loader with NO warning, while TS warns 'its base entity is now Customer, where before it was Invoice' — the same silent view replacement the L5 criterion ('the warning fires for every extender with no identity of its own') exists to surface, unreported on the C# port. Sibling sites needing the port: ValidationPasses.cs:1422-1463 (the pass) and the C# DeriveBaseEntity (needs the preRc21 flag mirroring validation-passes.ts:1017-1020). Fix round provenance: this is a gap the author's original L5 change (b06cb5a) left, not something a fix round moved.
  • ⚠️ server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinGenUtil.kt:583 - Sibling port the L3 fix skipped. The change makes Java and Python names generators drop the column constant for a derived (origin.*) field of a table-read entity, and the CHANGELOG entry frames the result as the four ports matching ('The TypeScript and C# names generators already left out... They now match') — but the fifth port's KotlinNamesGenerator never got the fix: KotlinGenUtil.resolveObjectNames (:583) and resolveSuperFragmentNames (:521) both call fieldMap(obj.metaFields, strategy) with no derived-field skip and no M8 compensation. Concrete sequence: an object.entity with a source.rdb table and a field.boolean isHigh carrying origin.computed still emits IS_HIGH_COLUMN = "is_high" in the generated Kotlin names object — a constant naming a column the table does not have, which a hand-written SQL consumer binds and fails on at runtime. That is exactly the L3 defect ('still emitted a column constant naming a column that does not exist'), surviving in the one port the intent did not name. The intent text (and the independent review it cites) names only Java and Python, so extending to Kotlin is a scope decision, not a mechanical given — hence ask-user. Sibling sites: KotlinGenUtil.kt:521 (fragment), :583 (object), and the M8 compensation would land beside whichever skip is added.
  • ℹ️ CHANGELOG.md:53 - Inline fix applied this pass: the verify --db entry said the fix 'does not check a variadic function's arity', but the change checks a variadic function's required fixed arity (declared-functions.ts:174-175) — only the trailing variadic count and type are unchecked, as DECLARED_FUNCTION_CHECK_LIMITS states precisely. Reworded to 'does not check a variadic function's trailing arity (its required fixed parameters still are)' so the changelog and the emitted diagnostic agree.

🔧 Fix applied.
3 issues (1 warning, 2 infos) still open:

  • ℹ️ server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringNamesGenerator.java:266 - Fix-round note (no action demanded): the M8 compensation fires only when the names super is an ABSTRACT entity. A write-through extender whose names super is a CONCRETE plain entity declaring a derived field would still reference a &lt;FIELD&gt;_COLUMN no emitted class declares — the same class of defect — because the concrete super's own module drops the constant (plain-entity columnless) and the child does not re-declare it. This scoping is byte-for-byte the TS (names.ts:390) and C# (CSharpNaming.cs:629) reference behavior, so it is a deliberate reference tradeoff this port correctly mirrors, not a porting defect; Java/Python pre-change emitted a constant naming a nonexistent column there instead. Recording it so the abstract-only scope is a known, symmetric boundary rather than an oversight. Sibling sites, all matching the reference: SpringNamesGenerator.java:266-272, names_generator.py:478-486.
  • ℹ️ CHANGELOG.md:53 - Inline fix applied this pass: the verify --db entry said the fix 'does not check a variadic function's arity', but the change checks a variadic function's required fixed arity (declared-functions.ts:174-175) — only the trailing variadic count and type are unchecked, as DECLARED_FUNCTION_CHECK_LIMITS states precisely. Reworded to 'does not check a variadic function's trailing arity (its required fixed parameters still are)' so the changelog and the emitted diagnostic agree.
  • ⚠️ server/typescript/packages/migrate-ts/src/introspect/declared-functions.ts:55 - Residual instance of the exact L4 defect class the intent required fixed ('Postgres-valid calls ... are reported as mismatches'). The fix round (acd363f) closed the integer family only: WIDER_NUMERIC maps integer→[bigint, numeric] and bigint→[numeric]. Postgres's implicit-cast set (pg_cast castcontext 'i') also accepts integer→real, integer→double precision, bigint→double precision, and real→double precision. Concrete sequence: an origin.function whose declared parameter is a field.int (pgTypeNames → ["integer"]) called against a function whose pg_proc parameter is double precision — parameterAccepts([&#34;integer&#34;], &#34;double precision&#34;) returns false, so verify --db reports a signature mismatch for a call Postgres executes fine; same for a field.float ("real") against a double-precision parameter. The CHANGELOG's own claim ('It now allows ... widening' framed as accepting what Postgres accepts) and the L4 criterion both cover this case. This is a gap the fix round left behind, not a new defect it introduced. Fix: extend WIDER_NUMERIC with integer→["real", "double precision"], bigint→["double precision"], real→["double precision"], plus one unit-test line in declared-functions-match.test.ts mirroring the existing widening tests.

🔧 Fix applied.
5 issues (1 warning, 4 infos) still open:

  • ℹ️ server/java/codegen-spring/src/main/java/com/metaobjects/generator/spring/SpringNamesGenerator.java:266 - Fix-round note (no action demanded): the M8 compensation fires only when the names super is an ABSTRACT entity. A write-through extender whose names super is a CONCRETE plain entity declaring a derived field would still reference a &lt;FIELD&gt;_COLUMN no emitted class declares — the same class of defect — because the concrete super's own module drops the constant (plain-entity columnless) and the child does not re-declare it. This scoping is byte-for-byte the TS (names.ts:390) and C# (CSharpNaming.cs:629) reference behavior, so it is a deliberate reference tradeoff this port correctly mirrors, not a porting defect; Java/Python pre-change emitted a constant naming a nonexistent column there instead. Recording it so the abstract-only scope is a known, symmetric boundary rather than an oversight. Sibling sites, all matching the reference: SpringNamesGenerator.java:266-272, names_generator.py:478-486.
  • ℹ️ CHANGELOG.md:53 - Inline fix applied this pass: the verify --db entry said the fix 'does not check a variadic function's arity', but the change checks a variadic function's required fixed arity (declared-functions.ts:174-175) — only the trailing variadic count and type are unchecked, as DECLARED_FUNCTION_CHECK_LIMITS states precisely. Reworded to 'does not check a variadic function's trailing arity (its required fixed parameters still are)' so the changelog and the emitted diagnostic agree.
  • ⚠️ server/typescript/packages/migrate-ts/src/introspect/declared-functions.ts:55 - Residual instance of the exact L4 defect class the intent required fixed ('Postgres-valid calls ... are reported as mismatches'). The fix round (acd363f) closed the integer family only: WIDER_NUMERIC maps integer→[bigint, numeric] and bigint→[numeric]. Postgres's implicit-cast set (pg_cast castcontext 'i') also accepts integer→real, integer→double precision, bigint→double precision, and real→double precision. Concrete sequence: an origin.function whose declared parameter is a field.int (pgTypeNames → ["integer"]) called against a function whose pg_proc parameter is double precision — parameterAccepts([&#34;integer&#34;], &#34;double precision&#34;) returns false, so verify --db reports a signature mismatch for a call Postgres executes fine; same for a field.float ("real") against a double-precision parameter. The CHANGELOG's own claim ('It now allows ... widening' framed as accepting what Postgres accepts) and the L4 criterion both cover this case. This is a gap the fix round left behind, not a new defect it introduced. Fix: extend WIDER_NUMERIC with integer→["real", "double precision"], bigint→["double precision"], real→["double precision"], plus one unit-test line in declared-functions-match.test.ts mirroring the existing widening tests.
  • ℹ️ server/typescript/packages/migrate-ts/src/introspect/declared-functions.ts:198 - Inline fix: the DECLARED_FUNCTION_CHECK_LIMITS diagnostic printed under verify --db findings still described only 'implicit integer widening (integer to bigint to numeric)', although the last fix round also widens onto real and double precision. Reworded to 'implicit numeric widening (integer to bigint to numeric, and each onto real or double precision)'. Message text only, and no test asserts it.
  • ℹ️ server/typescript/packages/migrate-ts/src/introspect/declared-functions.ts:12 - The inline diff has a second hunk that the recorded fix does not mention. It rewords the header comment (lines 12-15) to describe implicit numeric widening onto real and double precision. It is comment-only and matches the WIDER_NUMERIC table at lines 56-61, so it is inside the allowed class and correct. The recorded entry describes only the diagnostic message and says 'Message text only', which understates the change. No revert is needed.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 6 scenarios driven live against the product
Scenario Result Live Evidence
L5 positive: real meta verify on a disposable non-TPH projection extender whose base changed (InvoiceRow over CustomerBase, own field extends Invoice.ref) prints the widened-extender warning naming… ✅ pass live l5-verify-positive.log; l5-meta.model.json; bun server/typescript/packages/cli/bin/meta.ts verify in a scratch project
L5 negative: an extender whose own field already names the super's base (base unchanged) produces no widened-extender warning ✅ pass live l5-verify-negative.log
L4: meta verify --db on a disposable Postgres 16 accepts Postgres-valid calls (integer arg for bigint param, polymorphic anyelement, VARIADIC trailing) and still reports a genuine declared-type mism… ✅ pass live l4-verify-db-run.log; l4-meta.probe.json; disposable postgres:16 container on tmpfs with functions verify_fn.f_widen(bigint), f_poly(anyelement), v_join(text, VARIADIC integer[]), f_mis(bigint), stopp…
L3 Python: metaobjects gen names generator for a table-backed entity with a derived field no longer emits a column constant for it, while the projection keeps its own column ✅ pass live l3-py/account_names.fixed.py, l3-py/account_view_names.fixed.py, l3-py/account_names.base.py (base commit reproduces ACCOUNT_IS_HIGH_COLUMN = "is_high"), l3-py/meta.account.json
L3 Java: the SpringNamesGenerator omits the column constant for a derived field of a table-read entity, matching the TypeScript and C# behavior ⏸️ untested no Not driven live within this turn's budget. The Java reactor needs a Maven build with Testcontainers, and only the Python live scenario was driven. The fix mirrors the Python one. The in-repo SpringNam…
L8: the Java OMDB @stringValueMap EnumCodec has round-trip test coverage (JdbcCodecRoundTripTest) ⏸️ untested no The L8 change is test-only (a new test plus a fixture), so it has no product behavior to drive live. Running it needs the Java omdb module build and a Postgres via Testcontainers, which was not run in…
  • scripts/ci-local.sh --affected --strict-toolchains
  • bun server/typescript/packages/cli/bin/meta.ts verify on a disposable project (non-TPH projection extender whose base changed: InvoiceRow extends CustomerBase, own field extends Invoice.ref) -> warning printed naming Customer vs Invoice and the identity.primary remedy; exit 0
  • bun server/typescript/packages/cli/bin/meta.ts verify on the negative variant (InvoiceRow own field extends Customer.id, base unchanged) -> no widened-extender warning; exit 0
  • Started disposable postgres:16 container on tmpfs with fsync/synchronous_commit/full_page_writes off (port bound to 127.0.0.1), created schema verify_fn with f_widen(bigint), f_poly(anyelement), v_join(text, VARIADIC integer[]) and f_mis(bigint); ran bun .../cli/bin/meta.ts verify --db postgres://... -> origin.function findings only for f_mis (declared string vs bigint); widening int->bigint, polymorphic and variadic calls not reported; exit 1 driven only by the genuine mismatch (plus the expected unmigrated table/view create lines)
  • Scratch venv with PyYAML; PYTHONPATH=server/python/src python -m metaobjects.cli gen on a disposable project (Account entity with derived isHigh, AccountView projection, names generator) -> fixed tree: account_names.py has no IS_HIGH constant, account_view_names.py keeps ACCOUNTVIEW_DOUBLED_COLUMN
  • Same metaobjects gen against git archive 4c4658b89 server/python/src extracted to scratch -> base tree emits ACCOUNT_IS_HIGH_COLUMN = "is_high" (the pre-fix defect), confirming the scenario reproduces the reported failure before the fix
  • Baseline (not re-run): scripts/ci-local.sh --affected --strict-toolchains already passed at f4a081c15; no source or test files changed in this turn, so broad regression was not re-run.
⚠️ **Document** - 1 info
  • ⚠️ agent-context/skills/metaobjects-codegen/references/java.md:219 - Java, Kotlin and Python names reference docs (java.md:219, kotlin.md:227, python.md:161) still say the artifact carries a &lt;FIELD&gt;_FIELD/&lt;FIELD&gt;_COLUMN pair 'per field' and a complete COLUMNS_BY_FIELD. The change (fd45b0a / b06cb5a) makes those ports omit the column constant for a derived (origin.) field of an entity read from its table, as TypeScript and C# already do. The TypeScript (typescript.md:192) and C# (csharp.md:121) entries carry the same unqualified 'per field' wording, so the imprecision predates this change. The fixtures/agent-context-conformance//expected/.claude/skills/... copies of java.md, kotlin.md, python.md and physical-names.md are byte-identical to the source, so editing the source requires regenerating those expected outputs through the TS-owned agent-context emitter; they must not be hand-edited. Unresolved here because it needs that regeneration and a decision on one wording for all five ports.

🔧 Fix applied.
1 info still open:

  • ℹ️ agent-context/skills/metaobjects-codegen/references/typescript.md:192 - Resolved in this pass: the names entry in all five reference docs (typescript.md:192, csharp.md:121, java.md:219, kotlin.md:227, python.md:161) now states that a derived (origin.*) field of an entity read from its table has no names entry (no field or column constant, not in COLUMNS_BY_FIELD / ColumnsByField / the fields map), while a projection's or write-through entity's derived field keeps both. Two deviations from the recorded driver guidance, both to match the code: (1) the driver said the artifact 'carries a field constant for every field'. The code (fieldMap/FieldNames in Java, fieldNamesOf in TS, the NamesGenerator in C#, the names generator in Python) drops the whole per-field entry for a columnless derived field, so the _FIELD constant goes too; the wording says so. (2) docs/ports/python.md:285 carried the same flat 'per field' claim and was corrected with the same exception. docs/ports/java.md:448 has a summary-table cell 'per-field columns' that is not a contract statement and was left unchanged.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@dmealing
dmealing merged commit d3c665f into main Nov 18, 2026
10 checks passed
@dmealing
dmealing deleted the fm/mo-rc19-review-followups branch November 18, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant